/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import dao.AccuracyLevelsDao;
import dao.ProviderDao;
import java.sql.Connection;
import java.util.Vector;
import pojo.Provider;

/**
 *
 * @author A7med Kotb
 */
public class SearchSupplier 
{
    private Connection con;
    public SearchSupplier() 
    {
    }
    
    public Vector<Provider> searchProvider(Connection con,String param,int acclevel)
    {
        Vector<Provider> myfinalvect=new Vector<Provider>();
        ProviderDao prodao=new ProviderDao(con);
        AccuracyLevelsDao myaccdao=new AccuracyLevelsDao(con);
        Vector<Integer> mypid=myaccdao.getbyaccuracylevel(param, acclevel);
        for(int i=0;i<mypid.size();i++)
        {
            myfinalvect.add(prodao.getById(mypid.get(i)));
        }
        return myfinalvect;
    }
    
}
